package com.example.demo;/**
 * Created by kete on 2018-12-27.
 */

import com.example.demo.test.DateUtil;
import com.example.demo.test.HttpClientUtil;

/**
 * 作者：kete
 * 创建时间：2018-12-27 10:18
 * 功能描述：
 * 版本：
 */
public class WsTest {

    public static void preparmentTest(){
         String url="http://10.145.242.14:8088/AsyncRecharge/webservice/service";

        String body="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:base=\"http://base.webservice.ctsh.com\">\n" +
                "<soapenv:Header/>\n" +
                "<soapenv:Body>\n" +
                "<base:IfService>\n" +
                "<base:ifUser>SMS</base:ifUser>\n" +
                "<base:ifPass>ODD</base:ifPass>\n" +
                "<base:ifCode>AsyncRecharge</base:ifCode>\n" +
                "<base:ifEvent></base:ifEvent>\n" +
                "<base:info>\t\n" +
                "<![CDATA[ \t\n" +
                "    <ser:storenInAccontBalance>\n" +
                "    <request>\n" +
                "    <requestId>"+ DateUtil.getMsTime()+"CZ001</requestId>\t\n" +
                "    <tmpSN>"+ DateUtil.getMsTime()+"CZ001</tmpSN>\t\n" +
                "    <requestTime>"+DateUtil.getMsTime()+"</requestTime>\n" +
                "    <destinationId>99006113281</destinationId>\n" +
                "    <destinationAttr>6</destinationAttr>\t\n" +
                "    <destinationAttrDetail>1</destinationAttrDetail>\n" +
                "    <balanceType>64</balanceType>\n" +
                "    <rechargeFlag>0</rechargeFlag>\n" +
                "    <rechargeUnit>0</rechargeUnit>\n" +
                "    <objType>5BA</objType>\t\n" +
                "    <rechargeAccountType>1</rechargeAccountType>\t\n" +
                "    <rechargeAmount>1784</rechargeAmount>\t\n" +
                "    <rechargeFlowAmount>0</rechargeFlowAmount>\t\n" +
                "    <prolongDays>0</prolongDays>\n" +
                "    <destinationExpTime>20991231</destinationExpTime>\n" +
                "    <requestAmount>0</requestAmount>\t\n" +
                "    <cardNumber>0621105193</cardNumber>\n" +
                "    <channelID>08</channelID>\t\n" +
                "    <operSystem>02</operSystem>\n" +
                "    <organCode>898904</organCode>\n" +
                "    <secChannelCode>0615105152</secChannelCode>\n" +
                "    <payChunnel>1</payChunnel>\t\n" +
                "    <payForm>1</payForm>\t\n" +
                "    <noBillFlag>1</noBillFlag>\n" +
                "    <staffId></staffId>\t\n" +
                "    <prolongFlag></prolongFlag>\n" +
                "    <bonus><item><balanceType>2000</balanceType>\n" +
                "    <rechargeFlag>0</rechargeFlag><bonusUnit>0</bonusUnit>\n" +
                "    <bonusAmount>0</bonusAmount><startTime></startTime><endTime>\n" +
                "    </endTime></item>\t</bonus>\t</request>\t\n" +
                "    </ser:storenInAccontBalance>\t\n" +
                "]]>\t\n" +
                "</base:info>\n" +
                "<base:ifFull></base:ifFull>\n" +
                "</base:IfService> \n" +
                "</soapenv:Body>\n" +
                "</soapenv:Envelope>\t";

        String resp = HttpClientUtil.me().wsPost(url,body);

        System.out.println(resp);


    }
    public static void main(String[] args) {

        String url="http://10.7.69.140/IAMService/webservice/service";

        String body = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:base=\"http://base.webservice.ctsh.com\">\n" +
                "   <soapenv:Header/>\n" +
                "   <soapenv:Body>\n" +
                "      <base:IfService>\n" +
                "         <base:ifUser>iam</base:ifUser>\n" +
                "         <base:ifPass>iam123!Nav</base:ifPass>\n" +
                "         <base:ifCode>batchLateFeeAdj</base:ifCode>\n" +
                "         <base:ifEvent></base:ifEvent>\n" +
                "         <base:info><![CDATA[\n" +
                "\n" +
                "<Request>\n" +
                "  <RequestStaffId>AKA220</RequestStaffId>\n" +
                "  <RequestStaffName>\\u5f20\\u6770</RequestStaffName>\n" +
                "  <RequestPostnId>1-VMAP-120</RequestPostnId>\n" +
                "  <RequestDepartmentId>1-VMAA-1</RequestDepartmentId>\n" +
                "  <WorkOrderTitle/>\n" +
                "  <AdjReasonCode>401</AdjReasonCode>\n" +
                "  <WorkOrderSource>31</WorkOrderSource>\n" +
                "  <Annotation>\\u7528\\u6237\\u4e0d\\u8ba4\\u53ef\\uff0c\\31\\30\\30\\30\\30\\u53f7\\u5c0f\\u989d\\u8c03\\u6574</Annotation>\n" +
                "  <AdjLateFeeList>\n" +
                "    <AdjLateFee>\n" +
                "      <AdjAmount>330</AdjAmount>\n" +
                "      <TransType>2</TransType>\n" +
                "      <AccountNo>67463790835</AccountNo>\n" +
                "      <InvoiceNo>187405275536</InvoiceNo>\n" +
                "      <StatementDate>2019-03-01</StatementDate>\n" +
                "    </AdjLateFee>\n" +
                "    <AdjLateFee>\n" +
                "      <AdjAmount>240</AdjAmount>\n" +
                "      <TransType>1</TransType>\n" +
                "      <AccountNo>67463790835</AccountNo>\n" +
                "      <InvoiceNo>187305304043</InvoiceNo>\n" +
                "      <StatementDate>2019-02-01</StatementDate>\n" +
                "    </AdjLateFee>\n" +
                "    <AdjLateFee>\n" +
                "      <AdjAmount>950</AdjAmount>\n" +
                "      <TransType>2</TransType>\n" +
                "      <AccountNo>67463790835</AccountNo>\n" +
                "      <InvoiceNo>187205322624</InvoiceNo>\n" +
                "      <StatementDate>2019-01-01</StatementDate>\n" +
                "    </AdjLateFee>\n" +
                "  </AdjLateFeeList>\n" +
                "</Request>\n" +
                "\n" +
                "         ]]>\n" +
                "         </base:info>\n" +
                "         <base:ifFull/>\n" +
                "      </base:IfService>\n" +
                "   </soapenv:Body>\n" +
                "</soapenv:Envelope>";
//
//        String url="http://10.7.74.32:80/CQDWebService/services/ImyCQD";
//
//        String body = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ser=\"http://server.cqd.ideal.com\">\n" +
//                "   <soapenv:Header/>\n" +
//                "   <soapenv:Body>\n" +
//                "      <ser:queryBillDeail>\n" +
//                "         <ser:callNbr>19945766786</ser:callNbr>\n" +
//                "         <ser:startTime>20190101</ser:startTime>\n" +
//                "         <ser:endTime>20190125</ser:endTime>\n" +
//                "         <ser:pNum>0</ser:pNum>\n" +
//                "         <ser:busiType>AAA</ser:busiType>\n" +
//                "         <ser:channelNo>AK510/</ser:channelNo>\n" +
//                "         <ser:ip>10.7.98.42</ser:ip>\n" +
//                "         <ser:staffId>DetailListServiceImpl</ser:staffId>\n" +
//                "      </ser:queryBillDeail>\n" +
//                "   </soapenv:Body>\n" +
//                "</soapenv:Envelope>";
//
//        String url = "http://csb.sh.ctc.com:7805/openit/class_1?ServiceName=QueryConsumptioUsingData&ServiceVer=1.0&Consumer=IAMSVC";
//        StringBuffer sbf = new StringBuffer();
//        sbf.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
//        sbf.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
//                + "xmlns:req=\"http://server.abp.tydic.com/request\" "
//                + "xmlns:com=\"http://server.abp.tydic.com/common\">");
//        sbf.append("<soapenv:Header/>");
//        sbf.append("<soapenv:Body>");
//        sbf.append("<req:object>");
//        sbf.append("<com:head_object>");
//        sbf.append("<com:head head_name=\"CommandId\">9143</com:head>");
//        sbf.append("<com:head head_name=\"Version\">0</com:head>");
//        sbf.append("<com:head head_name=\"OriginSystemId\">0</com:head>");
//        sbf.append("<com:head head_name=\"DestSystemId\">0</com:head>");
//        sbf.append("<com:head head_name=\"TransactionId\">0</com:head>");
//        sbf.append("<com:head head_name=\"TimeStamp\">0</com:head>");
//        sbf.append("<com:head head_name=\"SequenceId\">0</com:head>");
//        sbf.append("<com:head head_name=\"ResendFlag\">0</com:head>");
//        sbf.append("<com:head head_name=\"MsgId\">0</com:head>");
//        sbf.append("<com:head head_name=\"ABPOrderNumber\">0</com:head>");
//        sbf.append("<com:head head_name=\"ABPRevision\">0</com:head>");
//        sbf.append("<com:head head_name=\"ABPLineNumber\">0</com:head>");
//        sbf.append("</com:head_object>");
//        sbf.append("<req:body_object>");
//        sbf.append("<req:body_attr rec_num=\"1\">");
//        sbf.append("<req:attr attr_name=\"0\">QueryUsingData</req:attr>");
//        sbf.append("<req:attr attr_name=\"1\">query</req:attr>");
//        sbf.append("<req:attr attr_name=\"RequestId\">20190218135203</req:attr>");
//        sbf.append("<req:attr attr_name=\"Object\">13301626349</req:attr>");
//        sbf.append("<req:attr attr_name=\"Billing_Cycle\">201902</req:attr>");
//        sbf.append("<req:attr attr_name=\"Object_type\">1</req:attr>");
//        sbf.append("</req:body_attr>");
//        sbf.append("</req:body_object>");
//        sbf.append("</req:object>");
//        sbf.append("</soapenv:Body>");
//        sbf.append("</soapenv:Envelope>");


        String resp = HttpClientUtil.me().wsPost(url,body);

        System.out.println(resp);

//        WsTest.preparmentTest();
    }
}
